<template>
  <view class="order">
    <view class="top">
      <view class="left-part">
        <view class="date">{{order.date}}</view>
        <view class="time">{{order.time}}</view>
      </view>
      <view class="right-part">
        {{order.status | calculateOrderStatus }}
      </view>
    </view>
    <s-house-card :item="order.house">
    </s-house-card>
    <view  class="bottom-button" @click="toCheck(order)">
      查看详情
    </view>
<!--    <view v-else  class="bottom-button" style="background-color: white" >-->
<!--    </view>-->
  </view>
  
</template>

<script>
  import sHouseCard from "../../components/sHouseCard"
  export default {
    filters: {
      calculateOrderStatus(val){
        switch (val) {
          case 0:
            return '待处理';
          case 1:
            return '已完成';
          case 2:
            return '已关闭';
          default:
            return '待沟通'
        }
      }
    },
    components: {
      sHouseCard,
    },
    data() {
      return {
      
      }
    },
    methods: {
      toCheck (order, ){
        this.$emit('toCheck',{
          order: order,
        })
      }
    },
    props:{
      order:{
        type: Object,
      }
    },
    mounted() {
    }
  }
</script>

<style scoped lang="scss">
@import "../myAppointment/style";

</style>
